package com.weimengchao.controller;

import com.weimengchao.domain.NacosConfig;
import com.weimengchao.entity.OrderInfo;
import com.weimengchao.service.OrderInfoService;
import com.zaxxer.hikari.HikariConfig;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @description:
 * @author: 魏孟超
 * @createDate: 2022-09-26 14:35
 */
@RestController
public class DemoController {

    @Resource
    NacosConfig nacosConfig;
    @Resource
    HikariConfig hikariConfig;
    @Resource
    OrderInfoService orderInfoService;

    @GetMapping("getConfig")
    public String getConfig() {
        return nacosConfig.getName();
    }


    @GetMapping("getById")
    public OrderInfo getById(Long id) {
        OrderInfo orderInfo = orderInfoService.selectById(id);
        return orderInfo;
    }
}
